﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using PMPUtils.DB;

namespace PMPUtils.Documentation
{
    public class ScopeOperator
    {
        public static DataTable ReadScopesInReview(String goalID)
        {
            return ReadScopes(goalID, "1");
        }

        public static DataTable ReadScopesNotInReview(String goalID)
        {
            return ReadScopes(goalID, "0");
        }

        public static DataTable ReadScopes(String goalID, String inReview)
        {
            String strQuery = "SELECT [author]      ,[goal_id]      ,[Rev]      ,[scope]      ,[ID]  FROM [scope] where to_review = " + inReview + " and goal_id = " + goalID + " order by id desc";
            DBOperator dbOperator = new DBOperator(DBConfigurations.LOCAL_CONNECTION_STRING);

            DataTable dtScopesInReview = dbOperator.Read(strQuery);
            return dtScopesInReview;
        }
    }
}
